package lesson.ch10;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;



public class Main {
	private static ApplicationContext context;

	public static void main(String[] args) {
		String packageName = Main.class.getPackage().getName().replaceAll("\\.","\\\\") ;
		System.out.println(packageName);
		context = new ClassPathXmlApplicationContext(packageName + "\\bean.xml");
		PeopleServiceBean  p = (PeopleServiceBean) context.getBean("PeopleServiceBean") ;
		People user1 = new People(20,"nick");
		p.save(user1);
		System.out.println(p.getUser(0));
		
	}
}
